// 加班申请列表
var overtimeColumns = [{
  id: 'pro',
  title: '归属项目',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'ftime',
  title: '开始时间',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
},{
  id: 'etime',
  title: '结束时间',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'msg',
  title: '申请说明',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'name',
  title: '申请人',
  type: 'string',
  width: 74,
  columnClass: 'text-center',
},{
  id: 'time',
  title: '申请时间',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
},{
  id: 'operation',
  title: '操作',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-success" onclick="toDo(' + record.id + ',' + record.doType + ');"><i class="fa fa-edit"></i>  查看办理</button>';
    return content;
  }
}];
var overtimeOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '加班申请列表',
  datas: [{
    id: 1,
    pro: '项目测试名称',
    ftime: '2019/01/02 12:00',
    etime: '2019/01/03 18:00',
    msg:'加班申请—关联项目负责人审批—审批结果',
    name: '张三',
    time: '2018/01/02 12:00',
    doType: 99
  },],
  columns: overtimeColumns,
  gridContainer: 'overtimeContainer',
  toolbarContainer: 'overtimeToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var overtimeGrid = $.fn.dlshouwen.grid.init(overtimeOption);
$(function () {
  overtimeGrid.load();
});

// 加班申请列表跳转
function toDo(id, doType) {
  if (doType == 99) {
    window.location.href = "../../do/edit/edit-do-99.html" + '?id=' + id + '&doType=' + doType;
  }
}